package com.gshrms.org.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gshrms.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gshrms.org.mapper.OrgPostCategoryMapper;
import com.gshrms.org.domain.OrgPostCategory;
import com.gshrms.org.service.IOrgPostCategoryService;

/**
 * 职级类别Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-10-28
 */
@Service
public class OrgPostCategoryServiceImpl extends ServiceImpl<OrgPostCategoryMapper,OrgPostCategory> implements IOrgPostCategoryService
{
    @Autowired
    private OrgPostCategoryMapper orgPostCategoryMapper;

    /**
     * 查询职级类别
     * 
     * @param postCategoryId 职级类别主键
     * @return 职级类别
     */
    @Override
    public OrgPostCategory selectOrgPostCategoryByPostCategoryId(Long postCategoryId)
    {
        return orgPostCategoryMapper.selectOrgPostCategoryByPostCategoryId(postCategoryId);
    }

    /**
     * 查询职级类别列表
     * 
     * @param orgPostCategory 职级类别
     * @return 职级类别
     */
    @Override
    public List<OrgPostCategory> selectOrgPostCategoryList(OrgPostCategory orgPostCategory)
    {
        return orgPostCategoryMapper.selectOrgPostCategoryList(orgPostCategory);
    }

    /**
     * 新增职级类别
     * 
     * @param orgPostCategory 职级类别
     * @return 结果
     */
    @Override
    public int insertOrgPostCategory(OrgPostCategory orgPostCategory)
    {
        orgPostCategory.setCreateTime(DateUtils.getNowDate());
        return orgPostCategoryMapper.insertOrgPostCategory(orgPostCategory);
    }

    /**
     * 修改职级类别
     * 
     * @param orgPostCategory 职级类别
     * @return 结果
     */
    @Override
    public int updateOrgPostCategory(OrgPostCategory orgPostCategory)
    {
        orgPostCategory.setUpdateTime(DateUtils.getNowDate());
        return orgPostCategoryMapper.updateOrgPostCategory(orgPostCategory);
    }

    /**
     * 批量删除职级类别
     * 
     * @param postCategoryIds 需要删除的职级类别主键
     * @return 结果
     */
    @Override
    public int deleteOrgPostCategoryByPostCategoryIds(Long[] postCategoryIds)
    {
        return orgPostCategoryMapper.deleteOrgPostCategoryByPostCategoryIds(postCategoryIds);
    }

    /**
     * 删除职级类别信息
     * 
     * @param postCategoryId 职级类别主键
     * @return 结果
     */
    @Override
    public int deleteOrgPostCategoryByPostCategoryId(Long postCategoryId)
    {
        return orgPostCategoryMapper.deleteOrgPostCategoryByPostCategoryId(postCategoryId);
    }
}
